import 'package:car_map/page/res/gaps.dart';
import 'package:car_map/utils/image_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class SquareTypeLifeItem extends StatelessWidget{

  final String title;
  final String urlPath;
  final Color colorbg;
  final VoidCallback callback;

  const SquareTypeLifeItem({Key key, this.title, this.urlPath,this.colorbg, this.callback}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return InkWell(
      onTap: callback,
      child: Container(
        width: ScreenUtil().setWidth(315.0),
        decoration: BoxDecoration(
            color: colorbg,
            borderRadius: BorderRadius.all(Radius.circular(10.0))
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Text(
              title,
              style: TextStyle(
                  color: Colors.white
              ),
            ),
            Gaps.hGap10,
            Image.asset(
              ImageUtils.getImgPath(urlPath),
              width: ScreenUtil().setWidth(60.0),
              height: ScreenUtil().setHeight(100.0),
            ),
          ],
        ),
      ),
    );
  }

}